﻿// Copyright (c) 2006 Antu Corporation。 
// 创建人  ：LinJian
// 创建时间：2007-3-23 16:52:35
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Antu.Business.Config
{
    /// <!--
    /// 功能描述  : 定义系统参数节点
    /// 创建人  : LinJian
    /// 创建时间: 2007-3-23 16:52:38
    /// 修改人  : 暂无他人修改
    /// 修改时间: 2007-3-23 16:52:39
    /// -->
    public class ChildSectionForSysParam:ConfigurationElement
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public ChildSectionForSysParam()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="strCommonFactorTableName">通用要素表的名字</param>
        /// <param name="strXzqTableName">行政区表的名字</param>
        /// <param name="strSuperUser">超级用户信息</param>
        /// <param name="nRecentOpenFilesCount">最近打开的文件</param>
        public ChildSectionForSysParam(string strCommonFactorTableName, string strXzqTableName, string strSuperUser, int nRecentOpenFilesCount)
        {
            CommonFactorTableName = strCommonFactorTableName;
            XzqTableName = strXzqTableName;
            SuperUserId = strSuperUser;
            RecentOpenFilesCount = nRecentOpenFilesCount;
        }

        #region 自定义字节属性值
        /// <summary>
        /// 自定义字节属性值(通用要素表的名字)
        /// </summary>
        [ConfigurationProperty("CommonFactorTableName", DefaultValue = "TSYS_TREE_STRUCT", IsRequired = true)]
        [StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 30)]
        public String CommonFactorTableName
        {
            get
            {
                return (String)this["CommonFactorTableName"];
            }
            set
            {
                this["CommonFactorTableName"] = value;
            }
        }

        /// <summary>
        /// 自定义字节属性值(行政区表的名字)
        /// </summary>
        [ConfigurationProperty("XzqTableName", DefaultValue = "TSYS_REGION_CODE", IsRequired = true)]
        [StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 30)]
        public String XzqTableName
        {
            get
            {
                return (String)this["XzqTableName"];
            }
            set
            {
                this["XzqTableName"] = value;
            }
        }

        /// <summary>
        /// 自定义字节属性值(超级用户信息)
        /// </summary>
        [ConfigurationProperty("SuperUserId", DefaultValue = "ADMIN", IsRequired = true)]
        [StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 30)]
        public String SuperUserId
        {
            get
            {
                return (String)this["SuperUserId"];
            }
            set
            {
                this["SuperUserId"] = value;
            }
        }

        /// <summary>
        /// 自定义字节属性值(最近打开的文件)
        /// </summary>
        [ConfigurationProperty("RecentOpenFilesCount", DefaultValue = "5", IsRequired = true)]
        public int RecentOpenFilesCount
        {
            get
            {
                return (int)this["RecentOpenFilesCount"];
            }
            set
            {
                this["RecentOpenFilesCount"] = value;
            }
        } 
        #endregion
    }
}
